[R-package] remove unused argument in early stopping callback #4342
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Noticed tonight that the function returned by
cb.early.stop()
has an argumentfinalize = FALSE
.That argument's value is never referenced, and no existing code expects to pass it. This PR proposes removing it.
The places where callbacks are executed only pass a single argument,
env
:LightGBM/R-package/R/lgb.train.R
Lines 288 to 290 in 28c3c45
LightGBM/R-package/R/lgb.train.R
Lines 329 to 331 in 28c3c45
LightGBM/R-package/R/lgb.cv.R
Lines 367 to 369 in 28c3c45
LightGBM/R-package/R/lgb.cv.R
Lines 393 to 395 in 28c3c45
I'm also confident in this change because there are multiple unit tests checking that early stopping works correctly in the R package, for example:
LightGBM/R-package/tests/testthat/test_basic.R
Line 576 in 28c3c45
Notes for Reviewers
This is not a user-facing breaking change because all callbacks are internal to the package (since #2479 is still open).